<?php

Route::namespace('Platform')->group(function (){
    #登录
    Route::post('admin/login', 'AdminController@login');
    Route::post('captcha/verify', 'CaptchaController@verify');

    Route::middleware(['platform.auth'])->group(function (){
        #管理员
        Route::prefix('admin')->group(function () {
            Route::get('','AdminController@index');
            Route::post('add', 'AdminController@add');
            Route::post('edit', 'AdminController@edit');
            Route::get('del/{id}','AdminController@del');
            Route::get('check_auth','AdminController@checkAuth');
        });

        #权限节点
        Route::prefix('admin/authrule')->group(function () {
            Route::get('','AuthRuleController@index');
            Route::post('add', 'AuthRuleController@add');
            Route::post('edit', 'AuthRuleController@edit');
            Route::get('del/{id}','AuthRuleController@del');
        });

        #权限组
        Route::prefix('admin/authgroup')->group(function () {
            Route::get('','AuthGroupController@index');
            Route::post('add', 'AuthGroupController@add');
            Route::post('edit', 'AuthGroupController@edit');
            Route::get('del/{id}','AuthGroupController@del');
        });

        #访问组
        Route::prefix('admin/authgroupaccess')->group(function () {
            Route::get('','AuthGroupAccessController@index');
            Route::post('add', 'AuthGroupAccessController@add');
            Route::post('edit', 'AuthGroupAccessController@edit');
            Route::get('del/{id}','AuthGroupAccessController@del');
        });

        #访问组
        Route::prefix('menu')->group(function () {
            Route::get('','MenuController@index');
            Route::post('save', 'MenuController@save');
            Route::get('del/{id}','MenuController@del');
            Route::get('check_auth','MenuController@checkAuth');
        });
    });
});









